#pragma once
#include "Syntax/Object/TypeKind.hpp"
#include <map>
#include <memory>
#include <string>

class Object;
typedef std::shared_ptr<Object> SharedObject;

class Object
{
private:
    TypeKind                               Type;
    static std::map<TypeKind, std::string> Names;

protected:
    // Object() : Object(Type::Null){};
    Object(TypeKind type) : Type(type) {}

public:
    virtual ~Object() {}

public:
    TypeKind GetType() const { return this->Type; }
    bool     IsMatch(TypeKind type) { return (this->Type == type); }

    std::string static GetTypeName(const TypeKind type)
    {
        auto it = Names.find(type);
        if (it != Names.end())
        {
            return it->second;
        }
        return "";
    }

    std::string         GetName() const { return Object::GetTypeName(this->Type); }
    virtual std::string ToString() const { return ""; };

public:
    static SharedObject NewInt(int64_t value);
    static SharedObject NewBool(bool value);
    static SharedObject NewString(std::string value);
};
